
import json

a = json.dumps("中国",ensure_ascii=True)
# print(a.encode("utf-8").decode("utf-8"))
from urllib.parse import unquote
url = "fleamarket://weex?url=https%3A%2F%2Fmarket.m.taobao.com%2Fapp%2FidleFish-F2e%2Fidlefish-renting-%20rax%2Fpages%2Forder-flow%3Fwh_weex%3Dtrue%26contractNo%3D6410922220%26need_login%3Dtrue"
# print(unquote(url))

dict = '{"$app_version":"3.9.5","$lib":"Android","$lib_version":"3.1.5","$manufacturer":"Xiaomi","$model":"$RedmiNote3"}'
str = '$app_version,"$lib"'
list = '["$app_version","$RedmiNote3"]'
list_ = '["app_version","RedmiNote3"]'
dict_ = '{"app_version":"3.9.5","lib":"Android","lib_version":"3.1.5","manufacturer":"Xiaomi","model":"RedmiNote3"}'
str_ = 'app_version,"lib"'
import re

# if "$" in dict_:
    # print(dict)

var = re.sub('\$','$$',"{\n  \"$os_version\" : \"13.1.2\",\n  \"$device_id\" : \"\
        7E3DFF8F-7BAC-42DF-983D-A8EA0AEFE967\",\n  \"distinct_id\" : \"41567\",\n\
        \  \"$os\" : \"iOS\",\n  \"$carrier\" : \"中国移动\",\n  \"$screen_height\" :\
        \ 812,\n  \"$is_first_day\" : false,\n  \"$screen_width\" : 375,\n  \"$model\"\
        \ : \"iPhone12,1\",\n  \"$wifi\" : true,\n  \"$network_type\" : \"WIFI\",\n\
        \  \"$app_version\" : \"5.0.9\",\n  \"$manufacturer\" : \"Apple\",\n  \"$lib\"\
        \ : \"iOS\",\n  \"gps_city\" : \"上海市\",\n  \"$lib_version\" : \"1.10.24\"\n\
        }")
# print(var)

import logging

logger = logging.getLogger("logger")
handler = logging.StreamHandler()
handler.setLevel(logging.DEBUG)
formatter = logging.Formatter("%(asctime)s %(name)s %(levelname)s %(message)s")
handler.setFormatter(formatter)
logger.addHandler(handler)
print(handler.level)
logger.debug('This is a customer debug message')
logger.info('This is an customer info message')
logger.warning('This is a customer warning message')
logger.error('This is an customer error message')
logger.critical('This is a customer critical message')


keys = {'json': {'sign': '958a05393efef0ac7c0fb80a7eac45e24fd40c27'}}.keys()
for k in keys:
    print(k)

str = "alipays://platformapi/startapp?appId=2018042560052166&page=pages/payment/thirdPartyPayment&query=user_id%3D41568%26bill_top_id%3D%26bill_all_id%3D187126%26coupon_id%3D%26payChannel%3D17%26device_id%3DBDF7AEF9-D8DD-460C-B94A-4D4361AEB0B8%26v%3D5.1.1%26from%3D2%26amount%3D"
from urllib.parse import unquote

print(unquote(str))



